define([
    'text!planmanage/addfileplan/templates/AddFilePlan_fifth.html',
    'planmanage/addfileplan/views/AddFilePlan_variable'
], function(AddFilePlanFifthViewTpl, VariableView) {
    return fish.View.extend({
        template: fish.compile(AddFilePlanFifthViewTpl),
        i18nData: fish.extend({}),
        events: {
            'click #button-add-plan': 'addPlan',
            'click #button-plan-grid': 'planGrid',
            'click #button-plan-grid-draft': 'planGridDraft'
        },

        initialize: function() {
            // 控制显示-草稿箱
            fish.on('showDraft', $.proxy(this.showDraft, this));
        },

        serialize: function() {
            return this.i18nData;
        },

        //这里用来初始化页面上要用到的fish组件
        afterRender: function() {
            var me = this;
        },

        // 继续添加计划 按钮点击事件
        addPlan: function(){
            fish.trigger('addPlan');
        },

        // 查看计划列表
        planGrid: function(){
            fish.trigger('planGrid');
        },

        // 查看草稿箱
        planGridDraft: function(){
            fish.trigger('planGridDraft');
        },

        // 控制显示-草稿箱
        showDraft: function(){
            $('#add_success_img').addClass("hidden");
            $('#draft_success_img').removeClass("hidden");
            $('#button-plan-grid').addClass("hidden");
            $('#button-plan-grid-draft').removeClass("hidden");
        }
    });
});